/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.universityUnits;

import model.entitys.Entity;
import model.staff.Student;

/**
 * Deanery of the faculty. Deanery own curriculum of the faculty.
 * @author Dmitri Paziy
 */
public class Deanery extends Entity<Curriculum> implements DeaneryInterface {
    private Faculty faculty;

    public Deanery(Faculty faculty) {
        this.faculty = faculty;
    }

    @Override
    public FacultyInterface getFaculty() {
        return faculty;
    }

    public void addStudent(Student student, DepartmentInterface department) {
    }
    
    public void addCurriculum(Curriculum curriculum) {
    }
    
    @Override
    public String toString() {
        return "Deanery{" + '}';
    }

    @Override
    public CurriculumInterface getGroupCurriculum(GroupInterface group) {
        for (int index = 0; index < size(); index++) {
            Curriculum curriculum = get(index);
            
            if (curriculum.getGroup().equals(group)) {
                return curriculum;
            }
        }
        
        return new Curriculum(group);
    }
}
